package com.ruoyi.depot.mapper;

import com.ruoyi.depot.domain.DTOReceiptProducts;
import com.ruoyi.depot.domain.QualityInspectionDetail;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.depot.domain.vo.QualityInspectionDetailVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
* @author Admin
* @description 针对表【tb_quality_inspection_detail(品检详细表)】的数据库操作Mapper
* @createDate 2024-11-18 10:15:08
* @Entity com.ruoyi.depot.domain.QualityInspectionDetail
*/
@Mapper
public interface QualityInspectionDetailMapper extends BaseMapper<QualityInspectionDetail> {

	/**
	 * 批量插入质检单详细
	 * @param inspectionDetails
	 * @return
	 */
	int insertBatch(@Param("list") List<QualityInspectionDetail> inspectionDetails);

	/**
	 * 根据质检详细id查询对应的采购订单号和商品id
	 * @param detailsId
	 */
	DTOReceiptProducts selectOrdersIdAndProductId(@Param("detailsId") String detailsId);

	/**
	 * 根据产品id查询库存次品量详细
	 * @param productId
	 * @return
	 */
	List<QualityInspectionDetailVO> selectQualityInspectionByProductId(@Param("vo") QualityInspectionDetailVO productId);

	/**
	 * 查询质检详细数据
	 * @param inspectionId
	 * @param productId
	 * @param gtins
	 * @return
	 */
	List<QualityInspectionDetail> selectDetails(@Param("inspectionId") String inspectionId,
										  @Param("productId") Long productId,
										  @Param("gtins") List<String> gtins);
}




